//
//  BDSaveShopInfoStep2Request.m
//  HSY
//
//  Created by 陈浩 on 2017/4/12.
//  Copyright © 2017年 金开门. All rights reserved.
//

#import "BDSaveShopInfoStep2Request.h"

@implementation BDSaveShopInfoStep2Request

- (NSString *)serviceCode{
    return BD_API_SERVICE_CODE_GET_SAVE_STEP2;
}

- (NSDictionary *)requestData{
    NSMutableDictionary *params = [@{} mutableCopy];
    params[@"id"] = self.mainStoreID;
    params[@"shortName"] = self.shortName;
    params[@"districtCode"] = self.districtCode;
    params[@"address"] = self.address;
    params[@"isPublic"] = [NSString stringWithFormat:@"%ld", (long)self.isPublic];
    params[@"fileA"] = @"LICENCE";
    if (self.licenceNO.length > 0) {
        params[@"licenceNO"] = self.licenceNO;
    }
    if (self.licenceStartDate.length > 0) {
        params[@"licenceStartDate"] = self.licenceStartDate;
    }
    if (self.licenceStartDate.length > 0) {
        params[@"licenceEndDate"] = self.licenceEndDate;
    }

    return [params copy];
}


- (NSArray<BDFileModel *> *)files{
    if (self.imageFile) {
        BDFileModel *model = [[BDFileModel alloc] init];
        model.fileData = self.imageFile;
        model.suffix = @"jpg";
        model.fileType = @"fileA";
        model.mimeType = @"image/png";
        
        return @[model];
    }else{
        return nil;
    }
}

- (BOOL)fileUplaod{
    return YES;
}

@end
